{$CLEO .cs}

03A4: script_name 'PIZZA'
0662: printstring "||====================================================================================||"
0662: printstring "||  MATANYEHOSHUA1 AND THEKOKSS, ONLY WE ARE ALLOWED TO TWEAK AND POST THESE SCRIPTS ||"
0662: printstring "||====================================================================================||"

:PIZZA_287
0001: wait 0 ms
00D6: if 
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @PIZZA_287
00D6: if 
0038: $ONMISSION == 0
004D: jump_if_false @PIZZA_287
00D6: if and
0AB0:   is_key_pressed 17
0AB0:   is_key_pressed 80
004D: jump_if_false @PIZZA_287

:PIZZA_344
0001: wait 0 ms
0247: load_model #PIZZABOY
0247: load_model #WMYPIZZ
0247: load_model #CELLPHONE
0AAC: 24@ = load_audio_stream "CLEO\CLEO_AUDIO\PIZZAORDER1.mp3"
0AAC: 25@ = load_audio_stream "CLEO\CLEO_AUDIO\PIZZAORDER2.mp3"
0AAC: 26@ = load_audio_stream "CLEO\CLEO_AUDIO\PIZZAORDER3.mp3"
0AAC: 27@ = load_audio_stream "CLEO\CLEO_AUDIO\PIZZAPAYOUT.mp3"
0AAC: 28@ = load_audio_stream "CLEO\CLEO_AUDIO\THANKS.mp3"
0AAC: 29@ = load_audio_stream "CLEO\CLEO_AUDIO\NOPIZZA.mp3"
0AAC: 30@ = load_audio_stream "CLEO\CLEO_AUDIO\PIZZALS.mp3"
0AAC: 31@ = load_audio_stream "CLEO\CLEO_AUDIO\PIZZASF.mp3"
038B: load_requested_models
00D6: if and
0248:   model #PIZZABOY available
0248:   model #WMYPIZZ available
0248:   model #CELLPHONE available
004D: jump_if_false @PIZZA_344
0842: $CURRENT_TOWN_NUMBER = player $PLAYER_CHAR town_number
0001: wait 0 ms
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 1  //  == constant
004D: jump_if_false @PIZZA_482
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 2  //  == constant
004D: jump_if_false @PIZZA_646
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 3  //  == constant
004D: jump_if_false @PIZZA_808
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 0  //  == constant
004D: jump_if_false @PIZZA_970
0002: jump @PIZZA_2242

:PIZZA_482
0001: wait 0 ms
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
0001: wait 3000 ms
0AAD: set_audio_stream 30@ state 1
00BC: show_text_highpriority GXT 'PZZ1A' time 3000 flag 1
0001: wait 3000 ms
0967: actor $PLAYER_ACTOR move_mouth 3000 ms
0AAD: set_audio_stream 25@ state 1
00BC: show_text_highpriority GXT 'PZZ2' time 3000 flag 1
0001: wait 3000 ms
0968: actor $PLAYER_ACTOR stop_mouth
0AAD: set_audio_stream 26@ state 1
00BC: show_text_highpriority GXT 'PZZ3' time 3000 flag 1
0001: wait 3000 ms
03E5: show_text_box 'PZZ6'
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
00A5: 2@ = create_car #PIZZABOY at 2111.158 -1824.871 13.5561
0587: enable_car 2@ validate_position 0
0129: 1@ = create_actor_pedtype 3 model #WMYPIZZ in_car 2@ driverseat
0175: set_car 2@ Z_angle_to 89.4914
0002: jump @PIZZA_1021
0001: wait 3000 ms
03E6: remove_text_box

:PIZZA_646
0001: wait 0 ms
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
0001: wait 3000 ms
0AAD: set_audio_stream 31@ state 1
00BC: show_text_highpriority GXT 'PZZ1B' time 3000 flag 1
0001: wait 3000 ms
0967: actor $PLAYER_ACTOR move_mouth 3000 ms
0AAD: set_audio_stream 25@ state 1
00BC: show_text_highpriority GXT 'PZZ2' time 3000 flag 1
0001: wait 3000 ms
0968: actor $PLAYER_ACTOR stop_mouth
0AAD: set_audio_stream 26@ state 1
00BC: show_text_highpriority GXT 'PZZ3' time 3000 flag 1
0001: wait 3000 ms
03E5: show_text_box 'PZZ6'
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
00A5: 2@ = create_car #PIZZABOY at -1852.626 947.3181 35.0586
0587: enable_car 2@ validate_position 0
0129: 1@ = create_actor_pedtype 3 model #WMYPIZZ in_car 2@ driverseat
0175: set_car 2@ Z_angle_to 180
0002: jump @PIZZA_1021
0001: wait 3000 ms
03E6: remove_text_box

:PIZZA_808
0001: wait 0 ms
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
0001: wait 3000 ms
0AAD: set_audio_stream 24@ state 1
00BC: show_text_highpriority GXT 'PZZ1C' time 3000 flag 1
0001: wait 3000 ms
0967: actor $PLAYER_ACTOR move_mouth 3000 ms
0AAD: set_audio_stream 25@ state 1
00BC: show_text_highpriority GXT 'PZZ2' time 3000 flag 1
0001: wait 3000 ms
0968: actor $PLAYER_ACTOR stop_mouth
0AAD: set_audio_stream 26@ state 1
00BC: show_text_highpriority GXT 'PZZ3' time 3000 flag 1
0001: wait 3000 ms
03E5: show_text_box 'PZZ6'
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
00A5: 2@ = create_car #PIZZABOY at 2075.608 2226.74 10.8203
0587: enable_car 2@ validate_position 0
0129: 1@ = create_actor_pedtype 3 model #WMYPIZZ in_car 2@ driverseat
0175: set_car 2@ Z_angle_to 180
0002: jump @PIZZA_1021
0001: wait 3000 ms
03E6: remove_text_box

:PIZZA_970
0001: wait 0 ms
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
0001: wait 3000 ms
0AAD: set_audio_stream 29@ state 1
00BC: show_text_highpriority GXT 'PZZ1D' time 3000 flag 1
0001: wait 3000 ms
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
0002: jump @PIZZA_2242

:PIZZA_1021
0001: wait 0 ms
072A: put_actor 1@ into_car 2@ driverseat
0187: 3@ = create_marker_above_actor 1@
0165: set_marker 3@ color_to 1

:PIZZA_1048
0001: wait 0 ms
04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 1.0 1.0 1.0
02C1: store_to 7@ 8@ 9@ car_path_coords_closest_to 4@ 5@ 6@
00A7: car 2@ drive_to 7@ 8@ 9@
00AD: set_car 2@ max_speed_to 160.0
00AE: set_car 2@ traffic_behaviour_to 2
09F6: set_actor 1@ unjackable_through_driver_seat 1
0001: wait 1000 ms
00D6: if 
8118:   not actor 1@ dead
004D: jump_if_false @PIZZA_2242
00D6: if 
01AE:   car 2@ sphere 0 near_point 7@ 8@ radius 20.0 20.0 stopped
004D: jump_if_false @PIZZA_1048
09F6: set_actor 1@ unjackable_through_driver_seat 0
05CD: AS_actor 1@ exit_car 2@

:PIZZA_1209
0001: wait 0 ms
04ED: load_animation "FOOD"
04ED: load_animation "GANGS"
00D6: if 
04EE:   animation "FOOD" loaded
04EE:   animation "GANGS" loaded

:PIZZA_1258
0001: wait 500 ms
00D6: if 
8118:   not actor 1@ dead
004D: jump_if_false @PIZZA_2242
04C4: store_coords_to 10@ 11@ 12@ from_actor $PLAYER_ACTOR with_offset 0.0 0.2 0.0
07CD: AS_actor 1@ walk_to 10@ 11@ 12@ stop_with_angle 0.0 within_radius 0.5
00D6: if 
00F2:   actor 1@ near_actor $PLAYER_ACTOR radius 1.0 1.0 0
004D: jump_if_false @PIZZA_1258
0639: AS_actor 1@ rotate_to_actor $PLAYER_ACTOR
0639: AS_actor $PLAYER_ACTOR rotate_to_actor 1@
0967: actor 1@ move_mouth 3000 ms
0AAD: set_audio_stream 27@ state 1
00BC: show_text_highpriority GXT 'PZZ4' time 3000 flag 1
0605: actor 1@ perform_animation "PRTIAL_GNGTLKB" IFP "GANGS" framedelta 10.0 loop 0 lockX 0 lockY 0 lockF 0 time 3000
0001: wait 3000 ms
0968: actor 1@ stop_mouth
0967: actor $PLAYER_ACTOR move_mouth 3000 ms
0AAD: set_audio_stream 28@ state 1
00BC: show_text_highpriority GXT 'PZZ5' time 3000 flag 1
0605: actor $PLAYER_ACTOR perform_animation "PRTIAL_GNGTLKC" IFP "GANGS" framedelta 10.0 loop 0 lockX 0 lockY 0 lockF 0 time 3000
0001: wait 3000 ms
0968: actor $PLAYER_ACTOR stop_mouth
0109: player $PLAYER_CHAR money += -12
0050: gosub @PIZZA_2132
0226: 20@ = actor $PLAYER_ACTOR health
000A: 20@ += 1000
0223: set_actor $PLAYER_ACTOR health_to 20@
0623: add 3 to_integer_stat 21
0623: add 1 to_integer_stat 21
00D6: if 
8118:   not actor 1@ dead
004D: jump_if_false @PIZZA_2242
05CB: AS_actor 1@ enter_car 2@ as_driver 2000 ms
0842: $CURRENT_TOWN_NUMBER = player $PLAYER_CHAR town_number
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 1  //  == constant
004D: jump_if_false @PIZZA_1655
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 2  //  == constant
004D: jump_if_false @PIZZA_1814
00D6: if 
84A3:   not $CURRENT_TOWN_NUMBER == 3  //  == constant
004D: jump_if_false @PIZZA_1973
0002: jump @PIZZA_2242

:PIZZA_1655
0001: wait 0 ms
00D6: if 
00DD:   actor 1@ driving_car_with_model #PIZZABOY
004D: jump_if_false @PIZZA_1655
0001: wait 500 ms
00A7: car 2@ drive_to 2111.158 -1824.871 13.5561
00AD: set_car 2@ max_speed_to 40.0
00AE: set_car 2@ traffic_behaviour_to 2
00D6: if and
8118:   not actor 1@ dead
0104:   actor 1@ near_actor $PLAYER_ACTOR radius 50.0 50.0 20.0 sphere 0
004D: jump_if_false @PIZZA_2242
00D6: if 
01AE:   car 2@ sphere 0 near_point 2111.158 -1824.871 radius 3.0 3.0 stopped
004D: jump_if_false @PIZZA_1655
05CD: AS_actor 1@ exit_car 2@
0002: jump @PIZZA_2242

:PIZZA_1814
0001: wait 0 ms
00D6: if 
00DD:   actor 1@ driving_car_with_model #PIZZABOY
004D: jump_if_false @PIZZA_1814
0001: wait 500 ms
00A7: car 2@ drive_to -1852.626 947.3181 35.0586
00AD: set_car 2@ max_speed_to 40.0
00AE: set_car 2@ traffic_behaviour_to 2
00D6: if and
8118:   not actor 1@ dead
0104:   actor 1@ near_actor $PLAYER_ACTOR radius 50.0 50.0 20.0 sphere 0
004D: jump_if_false @PIZZA_2242
00D6: if 
01AE:   car 2@ sphere 0 near_point -1852.626 947.3181 radius 3.0 3.0 stopped
004D: jump_if_false @PIZZA_1814
05CD: AS_actor 1@ exit_car 2@
0002: jump @PIZZA_2242

:PIZZA_1973
0001: wait 0 ms
00D6: if 
00DD:   actor 1@ driving_car_with_model #PIZZABOY
004D: jump_if_false @PIZZA_1973
0001: wait 500 ms
00A7: car 2@ drive_to 2075.608 2226.74 10.8203
00AD: set_car 2@ max_speed_to 40.0
00AE: set_car 2@ traffic_behaviour_to 2
00D6: if and
8118:   not actor 1@ dead
0104:   actor 1@ near_actor $PLAYER_ACTOR radius 50.0 50.0 20.0 sphere 0
004D: jump_if_false @PIZZA_2242
00D6: if 
01AE:   car 2@ sphere 0 near_point 2075.608 2226.74 radius 3.0 3.0 stopped
004D: jump_if_false @PIZZA_1973
05CD: AS_actor 1@ exit_car 2@
0002: jump @PIZZA_2242

:PIZZA_2132
0001: wait 0 ms
0A1A: actor $PLAYER_ACTOR perform_walk_animation "EAT_PIZZA" IFP "FOOD" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 -1 ms // versionC
04C4: store_coords_to 14@ 15@ 16@ from_actor $PLAYER_ACTOR with_offset 0.0 -1.0 -1.4
0107: 13@ = create_object 1582 at 14@ 15@ 16@
0382: set_object 13@ collision_detection 0
07C4: set_object 13@ axis_angle_relation_to 26 226 0 0
0051: return

:PIZZA_2242
0001: wait 0 ms
01C2: remove_references_to_actor 1@  // Like turning an actor into a random pedestrian
01C3: remove_references_to_car 2@
01C4: remove_references_to_object 13@  // This object will now disappear when the player looks away
0108: destroy_object 13@
0164: disable_marker 3@
0249: release_model #PIZZABOY
0249: release_model #WMYPIZZ
0249: release_model #CELLPHONE
04EF: release_animation "FOOD"
04EF: release_animation "GANGS"
0002: jump @PIZZA_287
